package com.example.myapplication.request

import androidx.lifecycle.MutableLiveData
import com.example.myapplication.bean.ListResultBean
import com.example.myapplication.bean.article.ArticleBean
import com.kun.base.net.Api
import com.kun.base.net.ResponseResult

/**
 *问答相关请求
 *
 * @author : Kun
 * @date : 2021/6/10
 * @time : 15:28
 */
class QuestionRequest {
    /**
     * 问答返回的结果
     */
    val questionResult = MutableLiveData<ResponseResult<ListResultBean<ArticleBean>>>()

    /**
     * 请求问答数据
     */
    suspend fun requestQuestion(index: Int) {
        questionResult.value = Api.apiCall {
            Api.getInstance(IApi::class.java).getQuestion(index)
        }
    }
}